﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin_cms/admin_master.master"
    AutoEventWireup="true" CodeFile="admin_manager_menu.aspx.cs" Inherits="hydevmanager_admin_manager_menu" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" />
    <asp:UpdatePanel runat="server" ID="upn">
        <ContentTemplate>
            <asp:GridView runat="server" ID="grAllMenu" AutoGenerateColumns="false" CssClass="grid_menu_all_style"
                RowStyle-CssClass="grid_rows" OnRowCommand="grAllenu_click" AlternatingRowStyle-BackColor="#DFE2E4">
                <Columns>
                    <asp:BoundField HeaderText="ID" DataField="idmenu" ItemStyle-HorizontalAlign="Center"
                        HeaderStyle-CssClass="grid_menu_all_header_style" ItemStyle-CssClass="grid_menu_all_item_style" />
                    <asp:BoundField HeaderText="Tên Menu" DataField="name_menu" ItemStyle-HorizontalAlign="Center"
                        HeaderStyle-CssClass="grid_menu_all_header_style" ItemStyle-CssClass="grid_menu_all_item_style" />
                    <asp:TemplateField HeaderText="..." ItemStyle-HorizontalAlign="Center" HeaderStyle-CssClass="grid_menu_all_header_style"
                        ItemStyle-CssClass="grid_menu_all_item_style">
                        <ItemTemplate>
                            <a href='EditMenu.aspx?IdMenu=<%#Eval("IdMenu") %>'>
                                <img src="style/cssTran/IMG/write_16.png" title="Click for Edit" /></a>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="SubMenu" ItemStyle-HorizontalAlign="Center" HeaderStyle-CssClass="grid_menu_all_header_style"
                        ItemStyle-CssClass="grid_menu_all_item_style">
                        <ItemTemplate>
                            <%#test_infor_menu(Convert.ToBoolean(Eval("has_child")), Convert.ToInt32(Eval("idmenu")))%>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Add SubMenu" ItemStyle-HorizontalAlign="Center" HeaderStyle-CssClass="grid_menu_all_header_style"
                        ItemStyle-CssClass="grid_menu_all_item_style">
                        <ItemTemplate>
                            <%#test_has_menu_child(Convert.ToBoolean(Eval("has_child")), Convert.ToInt32(Eval("idmenu"))) %>
                        </ItemTemplate>
                    </asp:TemplateField>
                   
                    <asp:BoundField HeaderText="Kiểu Dữ liệu" DataField="data_name" ItemStyle-HorizontalAlign="Center"
                        HeaderStyle-CssClass="grid_menu_all_header_style" ItemStyle-CssClass="grid_menu_all_item_style" />
                    <asp:TemplateField HeaderText="Sắp xếp" ItemStyle-HorizontalAlign="Center" HeaderStyle-CssClass="grid_menu_all_header_style"
                        ItemStyle-CssClass="grid_menu_all_item_style">
                        <ItemTemplate>
                            <asp:LinkButton runat="server" ID="lkdown" Width="16px" CssClass="float_left padding_2"
                                CommandArgument='<%#Eval("IdMenu")+"|down|"+Eval("menu_order") %>'><img alt='' src="style/cssTran/img/arrow_down_16.png" title="Click to Arrow Down (-1)" /></asp:LinkButton>
                            <a class="a_sapxep float_left">
                                <%#Eval("menu_order").ToString() %></a>
                            <asp:LinkButton runat="server" ID="lkup" Width="16px" CssClass="float_left padding_2"
                                CommandArgument='<%#Eval("IdMenu")+"|up|"+Eval("menu_order") %>'><img alt='' src="style/cssTran/img/arrow_up_16.png" title="Click to Arrow Up (+1)" /></asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Duyệt" ItemStyle-HorizontalAlign="Center" HeaderStyle-CssClass="grid_menu_all_header_style"
                        ItemStyle-CssClass="grid_menu_all_item_style">
                        <ItemTemplate>
                            <asp:LinkButton runat="server" ID="lkbrowrs" Width="16px" CommandArgument='<%#Eval("IdMenu")+"|browrs|"+Eval("Status") %>'
                                CssClass='<%#test_browrs_menu(Convert.ToBoolean(Eval("Status"))) %>' ToolTip='Click to Allow or Deny'></asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Xóa" ItemStyle-HorizontalAlign="Center" HeaderStyle-CssClass="grid_menu_all_header_style"
                        ItemStyle-CssClass="grid_menu_all_item_style">
                        <ItemTemplate>
                            <asp:LinkButton runat="server" ID="lkdelete" Width="16px" Enabled='<%#bool_inverse(Convert.ToBoolean(Eval("has_child"))) %>'
                                CommandArgument='<%#Eval("IdMenu")+"|delete|0" %>'><%#test_cant_delete(Convert.ToBoolean(Eval("has_child")))%></asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            <asp:Literal runat="server" ID="lt"></asp:Literal>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
